using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(LineRenderer))]
public class TeamLineRenderer : MonoBehaviour
{
	public List<Transform> pointsList;

	private LineRenderer lineRenderer;

	private Vector3[] GetPositions()
	{
		List<Vector3> list = new List<Vector3>();
		foreach (Transform points in pointsList)
		{
			list.Add(points.position);
		}
		return list.ToArray();
	}

	private void Start()
	{
		lineRenderer = GetComponent<LineRenderer>();
	}

	private void Update()
	{
		lineRenderer.SetPositions(GetPositions());
	}
}
